<h1 class="text-info text-center"> Project Management System </h1>
<br/>

<div class="container">

  <fieldset>
	<legend>Registration</legend>
	<%= form_for(@user) do |f| %>
	  <% if @user.errors.any? %>
		<div id = "error_display">
		  <h3><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h3>

		  <ul>
		  <% @user.errors.full_messages.each do |msg| %>
			<li><%= msg %></li>
		  <% end %>
		  </ul>
		</div>
	  <% end %>

  <div class="form-group">
    <%= f.label :first_name %>
    <%= f.text_field :first_name ,:placeholder =>"first_name"%>
  </div>
  <div class="form-group">
    <%= f.label :last_name %>
    <%= f.text_field :last_name ,:placeholder =>"last_name" %>
  </div>
  <div class="form-group">
    <%= f.label :role %>
    <%= f.select :role_id,Role.all.map { |role| [ role.role_name ,role.id] } %>
  </div>
    <div class="form-group">
    <%= f.label :email %>
    <%= f.text_field :email ,:placeholder =>"Email" %>
  </div>
  <div class="form-group">
    <%= f.label :phone_no %>
    <%= f.text_field :phone_no ,:placeholder =>"Phone No" %>
  </div>
  <div class="form-group">
    <%= f.label :login_name %>
    <%= f.text_field :login_name, :placeholder =>"4 to 20 characters long"%>
  </div>  
  <div class="form-group">
   <%= f.label :password %>
    <%= f.password_field :password,:placeholder =>" 6 to 20 characters long" %>
  </div>
  <div class="form-group">
   <%= f.label :password_confirmation %>
    <%= f.password_field :password_confirmation ,:placeholder =>" 6 to 10 characters long" %>
  </div>  
    <br/>
  <div class="actions">	
	<%= button_tag(type: "submit", class: "btn btn-primary") do %>
	Register
	<% end %>   
  </div>
<% end %>
</fieldset>

<%= link_to 'Go back to Login Page', new_account_path %>

</div>

